﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace MyWCF.Demo.Client.Web.Code
{
    public class ChatRoomManager
    {
        public static bool Add(ChatRoomEntity entity)
        {
            return ChatRoomDB.Add(entity);
        }

        public static List<ChatRoomEntity> GetList()
        {
            return ChatRoomDB.GetList();
        }

        public static bool AddUserIntoChatRoom(ChatRoomUsersEntity user)
        {
            return ChatRoomUsersDB.Add(user);
        }

        public static List<ChatRoomUsersEntity> GetUserListByChatRoomId(long chatRoomId)
        {
            return ChatRoomUsersDB.GetListByChatRoomId(chatRoomId);
        }

        public static bool AddMessage(ChatRoomMessagesEntity entity)
        {
            return ChatRoomMessagesDB.Add(entity);
        }

        public static List<ChatRoomMessagesEntity> GetMessageListBy(long chatRoomId,long lastMessageId)
        {
            return ChatRoomMessagesDB.GetListByChatRoomId(chatRoomId, lastMessageId);
        }

        public static List<ChatRoomMessagesEntity> GetChatRoomMessageList(long userId, long lastMessageId)
        {
            return ChatRoomMessagesDB.GetChatRoomMessageList(userId, lastMessageId);
        }
    }
}
